export function findFirstElement(arrays, key, value) {
    let target = null;
    for (let index = 0; index < arrays.length; index += 1) {
        if (arrays[index][key] === value) {
            target = arrays[index];
            break;
        }
        if (arrays[index].children instanceof Array && arrays[index].children.length > 0) {
            const t = findFirstElement(arrays[index].children, key, value);
            if (t)
                return t;
        }
    }
    return target;
}
